package com.ruoyi.business.dao;

import com.ruoyi.business.domain.CarMain;
import com.ruoyi.business.domain.Cardetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;


/**
 * cardetailDao接口
 *
 * @author liutietou
 * @since 1.0 2025-07-15
 */
@Repository
public interface CardetailDao extends JpaRepository<Cardetail, Integer>, JpaSpecificationExecutor<Cardetail> {

    @Transactional
    @Modifying
    int  deleteByMainid(CarMain  carMain);

    @Query
    List<Cardetail> findByMainid(CarMain  carMain);

}
